package com.house.user.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.house.user.dao.RoleDao;
import com.house.user.dao.UserDao;
import com.house.user.entity.Role;
import com.house.user.entity.User;
import com.house.user.service.IRoleService;
import com.house.user.service.IUserService;

@Service
@Transactional
public class RoleServiceImpl implements IRoleService{

	
	@Autowired
	private RoleDao roleDao;

	@Override
	public void saveOrUpdate(Role role) {
		// TODO Auto-generated method stub
		roleDao.save(role);
	}

	@Override
	public void delete(Role role) {
		// TODO Auto-generated method stub
		roleDao.delete(role);
	}



	@Override
	public List<Role> findAll() {
		// TODO Auto-generated method stub
		List<Role> list = (List<Role>) roleDao.findAll();
		return list;
	}

	@Override
	public Role findOne(Integer id) {
		// TODO Auto-generated method stub
		Role role = roleDao.findOne(id.longValue());
		return role;
	}


	
}
